#include<iostream>
using namespace std;

void moveZeros(int nums[], int size) {
    int count = 0;
    
    for (int i = 0; i < size; i++) {
        if (nums[i] != 0) {
            nums[count++] = nums[i];
        }
    }

    while (count < size) {
        nums[count++] = 0;
    }
}

int main() {
    int nums[] = {0, 1, 0, 3, 12};
    int size = sizeof(nums) / sizeof(nums[0]);

    cout << "移动前的数组：";
    for (int i = 0; i < size; i++) {
        cout << nums[i] << " ";
    }
    cout << endl;

    moveZeros(nums, size);

    cout << "移动后的数组：";
    for (int i = 0; i < size; i++) {
        cout << nums[i] << " ";
    }
    cout << endl;

    return 0;
}